<?php

$params = call_user_func_array(['yii\helpers\ArrayHelper', 'merge'], [
    require __DIR__ . '/../../common/config/params.php',
    require __DIR__ . '/../../common/config/params-local.php',
    require __DIR__ . '/params.php',
    require __DIR__ . '/params-local.php'
]);

return [
    'id' => 'app-console',
    'basePath' => dirname(__DIR__),
    "aliases" => [
        '@migrationdata' => '@app/data',
    ],
    'bootstrap' => ['log'],
    'controllerNamespace' => 'console\controllers',
    'controllerMap' => [
        'fixture' => [
            'class' => 'yii\console\controllers\FixtureController',
            'namespace' => 'common\fixtures',
        ],
        'migrate' => [
            'class' => 'console\controllers\MigrateController',
            'migrationPath' => [
                '@app/migrations/table',
                '@app/migrations/data',
            ],
        ],
    ],
    'components' => [
        'authManager' => [
            'class' => 'mdm\admin\components\DbManager',
        ],
        'log' => [
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
    ],
    'params' => $params,
    'on beforeRequest' => function ($event) {
        return;
    },
];
